<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <%@ include file="/commons/taglibs.jsp"%>
<%@ include file="/commons/commonEdit.jsp" %>
<%@ include file="/commons/validation.jsp"%>
<%@ include file="/commons/dateTime.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<script type="text/javascript" src="${ctx }/scripts/public3.js"></script>
<script type="text/javascript" src="${ctx}/scripts/ajaxException.js"></script>
<script type="text/javascript" src="${ctx}/scripts/div/common.js"></script>
<title>竣工初验${isReinspection }</title>
<script type="text/javascript">
	function submitFun(close){

		var isPass=$('inspection').fireEvent("onSubmit");
		if(isPass){
			closeORopenButton();
			var param = Form.serialize('inspection');
			<c:if test="${isReinspection!='1' }">
			var url = '${ctx}/renovation_firstInspectionAction.do?method=editFirstInspection';
			</c:if>
			//
			<c:if test="${isReinspection=='1' }">
			var url = '${ctx}/renovation_reinspectionAction.do?method=editReinspection';
			</c:if>
			new Ajax.Request(url,{method: 'post',parameters :param ,onSuccess : function(response){
				closeORopenButton();
	            ajaxSubmitException(response.responseText);
		       		//findFrame('ReinspectionListIForm').refresh();
		       		var obj=findFrame('inspectionRequisitionList');
		       		<c:if test="${isReinspection=='1' }">
		       		var paren=findFrame('ReinspectionListIForm');
		       		paren.refresh();
		       		</c:if>
		       		if(close){
		       			var firstInspectionId =  response.responseText;
		       			//初验

		       			<c:if test="${isReinspection!='1' }">
		       			obj.parent.openInspectionViolation('${inspectionRequisitionId }',firstInspectionId,false);
		  				</c:if>
		       			//复验

		       			<c:if test="${isReinspection=='1' }">
		       			obj.parent.openInspectionViolation('${inspectionRequisitionId }',firstInspectionId,true);
		       			</c:if>
		       			var obj=findFrame('inspectionRequisitionList');
						obj.parent.refresh();
		       			windowClose();
			       	}
		       		else{
		       			var obj=findFrame('inspectionRequisitionList');
						obj.parent.refresh();
		       			windowClose();
		       		}
		        }
			});
		}
	}

	function renovateTypeAlter(typeName){ //装修类型改变时必填样式改变

		if (typeName){
			$('remarktd').className="aux_intable_td2";

			Validation.removeElmValidate('remark');
			$('remark').className="textareatext max-length-100";
		}else{

			$('remarktd').className="aux_intable_require_more";
			$('remark').className="textareatext required max-length-100";

		}
	}

	function closeORopenButton(){
		$('btn1_22').disabled= !$('btn1_22').disabled;
		$('btn1_42').disabled= !$('btn1_42').disabled;
	}
	function init(){
		$('head_intext').innerHTML = '竣工复验';
	}

</script>
</head>
<body <c:if test="${isReinspection=='1' }">onload="init()"</c:if>>


<form name="inspection" id="inspection" action="${ctx}/renovation_firstInspectionAction.do?method=editFirstInspection" method="post" class="required-validate">
<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr>
    <td colspan="2" class="window_head_outBg"><table border="0" cellpadding="0" cellspacing="0">
      <tr>
        <td><img src="${ctx}/images/ico_Advance.gif" width="16" height="16" align="absmiddle" /> <span class="window_head_intext" id="head_intext">竣工初验</span></td>
        </tr>
    </table></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_1"></td>
  </tr>
  <tr>
    <td colspan="2" class="aux_header_line_2"></td>
  </tr>
  <tr>
    <td colspan="2" class="content"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td class="aux_outtable_color"><table width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color">
		  <tr>
		    <td class="aux_intable_td1">验收时间：</td>
		    <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
                <tr>
                  <td><input type="hidden" id="inspectionRequisitionId" name="inspectionRequisitionId" value="${inspectionRequisitionId }" />
                  <input type="hidden" id="keyword" name="keyword" value="${firstInspectionVO.keyword }" />
                  <input name="inspectionDateStr" id="inspectionDateStr" type="text" class="inputtext required validate-dateTime-yyyy-mm-dd-HH时  validate-ajax" <c:if test="${isReinspection!='1' }">validateUrl="${ctx }/renovation_inspectionRequisitionAction.do?method=validate&isFirst=false&keyword=${inspectionRequisitionId }"</c:if> <c:if test="${isReinspection=='1' }">validateUrl="${ctx }/renovation_inspectionRequisitionAction.do?method=validate&isFirst=true&keyword=${inspectionRequisitionId }"</c:if> size="16" value="${firstInspectionVO.inspectionDateStr }" /></td>
                  <td width="4">&nbsp;</td>
                  <td><a href="#"><img id="inspectionDateImg" src="${ctx}/images/ico_clock.gif" alt="请点选查找日期" border="0" /></a></td>
                </tr>
            </table></td>
              <td class="aux_intable_td1">验收小组成员：</td>
              <td class="aux_intable_require"><table border="0" cellspacing="0" cellpadding="0">
                  <tr>
                    <td><input name="members" id="members" type="text" class="inputtext required" value="${firstInspectionVO.members }" size="32" maxlength="36"/></td>
                    <td width="4">&nbsp;</td>
                    <td></td>
                  </tr>
              </table></td>
		  </tr>

		   <tr>
		    <td valign="top" class="aux_intable_td1">验收结果：</td>
		    <td colspan="3" class="aux_intable_require">
		    <input name="result" type="radio" value="001" <c:if test="${firstInspectionVO.result == '001'|| firstInspectionVO.result == null }">checked="checked"</c:if>  onClick="javascript:renovateTypeAlter(true);" />
                                  通 过    &nbsp;　&nbsp;　&nbsp;　&nbsp;
                                  <input type="radio" name="result" <c:if test="${firstInspectionVO.result == '002' }">checked="checked"</c:if> value="002" onClick="javascript:renovateTypeAlter(false);" />
                        不通过</td>
		    </tr>
		 <tbody colspan="4" width="100%" border="0" cellpadding="0" cellspacing="1" class="aux_intable_color" id="table01" style="display:show">
		  <tr>
            <td valign="top" class="aux_intable_td1">备 注：</td>
            <td colspan="3" id="remarktd" class="aux_intable_td2"><textarea name="remark" id="remark" cols="26" rows="3" class="textareatext max-length-100">${firstInspectionVO.remark }</textarea></td>
            </tr>
			</tbody>

        </table></td>
      </tr>
    </table></td>
  </tr>
  <tr>

    <td class="window_footer"><table border="0" cellspacing="0" cellpadding="0">
      <tr>
	  <td><table border="0" cellpadding="0" cellspacing="0">
        <tr>
          <td class="buttonOffLeft" id="btn1_41"></td>
          <td class="buttonOffMiddle" id="btn1_42" onClick="javascript:submitFun(true);" onMouseOver="btn_change_over(4)" onMouseOut="btn_change_out(4)" onBlur="btn_change(4)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 保存并违规登记</td>
          <td class="buttonOffRight" id="btn1_43"></td>
        </tr>
      </table></td>
	  <td class="btn_between_space"></td>
	  <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_21"></td>
              <td class="buttonOffMiddle" id="btn1_22" onClick="javascript:submitFun(false);" onMouseOver="btn_change_over(2)" onMouseOut="btn_change_out(2)" onblur="btn_change(2)"><img src="${ctx}/images/ico_ok.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 保 存</td>
              <td class="buttonOffRight" id="btn1_23"></td>
            </tr>
        </table></td>
        <td class="btn_between_space"></td>
        <td><table border="0" cellpadding="0" cellspacing="0">
            <tr>
              <td class="buttonOffLeft" id="btn1_31"></td>
              <td class="buttonOffMiddle" id="btn1_32" onClick="javascript:windowClose();" onMouseOver="btn_change_over(3)" onMouseOut="btn_change_out(3)" onblur="btn_change(3)"><img src="${ctx}/images/ico_cancel.gif" alt="" width="14" height="14" border="0" align="absbottom" /> 关 闭</td>
              <td class="buttonOffRight" id="btn1_33"></td>
            </tr>
        </table></td>
      </tr>
    </table>
    <p>&nbsp;</p></td>
  </tr>
</table>
</form>
<script type="text/javascript">
             Calendar.setup(
              {
	              inputField : "inspectionDateStr", // ID of the input field
	              ifFormat : "%Y-%m-%d %H时", // the date format
	              button : "inspectionDateImg", // ID of the button
	             // align          :    "Tl",           // alignment (defaults to "Bl")
			      singleClick    :    true
              }
              );
             </script>
</body>
</html>